{include file="common/Header.html"}
<body>
<style type="text/css">
body {
	background:#333;
}
a {
	color:#ffffff;
}
</style>
<form method="post">
		<div id="login">
				<dl>
					<dd>用户名：<input class="text" type="text" name="username" id="username" /></dd>
					<dd>密&nbsp;&nbsp;&nbsp;码：<input class="text" type="password" name="password" id="password" /></dd>
					<dd style="margin-left:50px"><input type="checkbox" name="autologin" value="yes">自动登录&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:repass();">忘记密码？</a></dd>
					<dd style="margin-left:25px"><div class="aui_buttons"  style="text-align:left;"><button type="submit" id="dologin" class="aui_state_highlight">登录</button> <button type="reset" class="aui_state_highlight">重置</button></div></dd>
				</dl>
		</div>
</form>
<script type="text/javascript">
$(function() {
	$("#dologin").click(function(){
		showDialog();
		var autologin=$("input[type='checkbox']").is(':checked') ? $("input[type='checkbox']").attr('value') : '';
		$.ajax({
			type:"post",
			url:"{'Admin/Login/check'|url}",
			data:"username="+$("#username").val()+"&password="+$("#password").val()+"&autologin="+autologin,
			dataType:'json',
			timeout:20000,
			global:false,
			success:function(data){
				if(data.status==1){
					showDialog('恭喜你，登录成功','success',null,'top.location.href="'+data.url+'";',1,null,null,null,null,3,3);
				}else{
					showAlert('error',data.info);
				}
			}
		});
		return false;
	});
});
function repass(){
	showDialog('<div style="margin-left:20px;font-size:14px;"><br><p>下载原版里的/temp/db/master.MYD 上传到你的空间覆盖原来的<br>即恢复为默认的后台账号密码admin admin</p></div>','notice');
}
</script>
</body>
</html>